@extends('layouts.app')

@section('content')

    <heading>修改赞赏码</heading>
    <card>

        <tig-form action="{{ route('users.reward.update',['user'=>$user]) }}" :is-update="true" :has-file="true">
            @if($user->reward)
            <default-field>
                <template slot="label" :fieldName="'url'">当前图片</template>
                <template slot="field">
                    <img src="{{$user->reward->url}}" alt="赞赏码" class="max-w-sm">
                </template>
            </default-field>
            @endif
            <default-field>
                <template slot="label" :fieldName="'url'">赞赏码图片</template>
                <template slot="field">
                    <span class="form-file mr-4">
                    <input title="链接" type="file" name="image"
                        />


                    </span>
                </template>
            </default-field>

            <default-field>
                <template slot="field">
                    <button type="submit" class="btn btn-default btn-primary">
                        修改
                    </button>
                </template>
            </default-field>
        </tig-form>

    </card>

@endsection
